package cn.xinfei.xdecision.common.model.datax.exception;


public enum XDecisionDataExceptionType {


    COMMON_SERVER_ERROR(1000, "系统异常，请稍后再试!", XDecisionDataLogType.ERROR),
    COMMON_ILLEGAL_PARAM(1001, "参数异常!", XDecisionDataLogType.ERROR),
    COMMON_RESPONSE_TIMEOUT(1002, "响应超时!", XDecisionDataLogType.ERROR),
    COMMON_NULL_POINT(1003, "空指针错误!", XDecisionDataLogType.ERROR),
    COMMON_ILLEGAL_STATE(1004, "断言错误!", XDecisionDataLogType.ERROR),
    COMMON_CLASS_CAST_EXCEPTION(1005, "类型转换错误!", XDecisionDataLogType.ERROR),
    COMMON_ILLEGAL_MOBILE_NUMBER(1006, "手机号格式不正确!", XDecisionDataLogType.WARNING),

    DATA_TRANSFER_TIME_OUT(2000, "请求Datatransfer超时!", XDecisionDataLogType.ERROR),
    DATA_TRANSFER_RESPONSE_EMPTY(2001, "请求Datatransfer返回为空!", XDecisionDataLogType.ERROR),
    DATA_TRANSFER_RESPONSE_ERROR(2002, "请求Datatransfer异常!", XDecisionDataLogType.ERROR),
    DATA_TRANSER_SOCKER_TIMEOUT_ERROR(2003, "请求Datatransfer socket timeout异常!", XDecisionDataLogType.ERROR),


    DATA_REQUEST_GATEEAY_TIME_OUT(3000, "请求Gateway超时!", XDecisionDataLogType.ERROR),
    DATA_MODEL_TIME_OUT(3001, "请求模型平台超时!", XDecisionDataLogType.ERROR),
    DATA_SYNC_REQUEST_GATEEAY_ERROR(3002, "同步请求Gateway异常!", XDecisionDataLogType.ERROR),
    DATA_ASYNC_REQUEST_GATEEAY_ERROR(3003, "异步请求Gateway异常!", XDecisionDataLogType.ERROR),
    DATA_SYNC_REQUEST_GATEEAY_EMPTY_ERROR(3004, "同步请求gateway为空!", XDecisionDataLogType.ERROR),
    DATA_GET_INTERFACE_VAR_ERROR(3005, "获取接口变量异常!", XDecisionDataLogType.ERROR),
    DATA_ACCESS_INTERFACE_SOURCE_REQUEST_MISSING_ERROR(3006, "请求接口源 必传参数缺失异常!", XDecisionDataLogType.ERROR),



    DATA_CREDIT_TIME_OUT(4000, "请求人行超时!", XDecisionDataLogType.ERROR),
    CODE_REQUEST_MIDOFFICE_ERROR(4001, "中台网关回调异常!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_CREDIT_STATUS_TYPE_ERROR(4002, "没有该类型的人行报告状态!", XDecisionDataLogType.ERROR),
    DATA_CREDIT_UPLOAD_RETRY_ERROR(4003, "人行征信重新上报异常!", XDecisionDataLogType.ERROR),
    DATA_CREDIT_RUTE_CHANNEL_ERROR(4004, "人行征信渠道路由异常!", XDecisionDataLogType.ERROR),
    DATA_CREDIT_VAR_CAL_ERROR(4005, "人行变量计算异常!", XDecisionDataLogType.ERROR),
    DATA_CREDIT_REPORT_FETCH_ERROR(4006, "人行征信报告查询异常!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_CREDIT_UPLOAD_STATUS_TYPE_ERROR(4007, "没有该征信上报状态类型!", XDecisionDataLogType.ERROR),





    DATA_EXECUTOR_ERROR(5000, "执行器执行异常!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_EXECUTOR_ERROR(5001, "没有该类型的执行器!", XDecisionDataLogType.ERROR),
    DATA_HTTP_STANDARD_EXECUTOR_ERROR(5002, "Http-Standard 执行器异常!", XDecisionDataLogType.ERROR),
    DATA_HTTP_VIRTUAL_EXECUTOR_ERROR(5003, "Http-Virtual 执行器异常!", XDecisionDataLogType.ERROR),
    DATA_GROOVY_EXECUTOR_ERROR(5004, "Groovy 执行器异常!", XDecisionDataLogType.ERROR),
    DATA_SQL_EXECUTOR_ERROR(5005, "Sql 执行器异常!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_COLLECT_STAGE_ERROR(5006, "没有该采集阶段!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_VAR_VIRTUAL_TYPE_ERROR(5007, "没有该类型的虚拟数据源变量!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_REQUEST_ERROR(5008, "没有该类型的请求!", XDecisionDataLogType.ERROR),
    DATA_EXECUTOR_FUTURE_GET_ERROR(5009, "执行器获取结果异常!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_STRATEGY_HANDLER_TYPE_ERROR(5010, "没有该类型的策略处理器!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_INTERFACE_DATASOURCE_ERROR(5011, "没有该类型的接口源!", XDecisionDataLogType.ERROR),
    DATA_EXECUTOR_ACCESS_PYTHON_ERROR(5012, "访问Python接口异常!", XDecisionDataLogType.ERROR),
    DATA_HANDLER_EXECUTE_ERROR(5013, "变量Handler处理器执行异常!", XDecisionDataLogType.ERROR),
    DATA_HTTP_CLIENT_RETRY_POLICY_ERROR(5014, "变量请求重试策略异常!", XDecisionDataLogType.ERROR),
    DATA_CREDIT_CALL_ERROR(5015, "征信调用异常!", XDecisionDataLogType.ERROR),


    EXPRESSION_ERROR(6000,"表达式解析异常",XDecisionDataLogType.ERROR),
    VARIABLE_TYPE_ERROR(6001,"变量类型异常",XDecisionDataLogType.ERROR),
    DERIVE_PARAM_SCRIPT_ERROR(6002,"衍生变量脚本异常",XDecisionDataLogType.ERROR),
    DERIVE_PARAM_DEFAULT_ERROR(6003,"依赖变量未设置默认值异常",XDecisionDataLogType.ERROR),
    DERIVE_PARAM_SCRIPT_CHECK_RESULT_ERROR(6004,"衍生变量脚本校验异常",XDecisionDataLogType.ERROR),
    DERIVE_PARAM_INPUT_ERROR(6005,"引用变量为空或超过最大限制",XDecisionDataLogType.ERROR),
    LISTDETAIL_FILE_CONTENT_ERROR_CODE(6006,"文件内容格式不合法",XDecisionDataLogType.ERROR),
    FILE_UPLOAD_ERROR(6007,"文件上传失败",XDecisionDataLogType.ERROR),
    TEMPLATE_DOWNLOAD_ERROR_CODE(6008,"模版文件下载异常",XDecisionDataLogType.ERROR),
    MESSAGE_QUEUE_PRODUCE_ERROR(6009,"消息发送失败",XDecisionDataLogType.ERROR),


    PROVIDER_RESPONSE_ERROR(7000, "请求Provider异常!", XDecisionDataLogType.ERROR),
    PROVIDER_RESPONSE_TIMEOUT_ERROR(7001, "请求provider超时异常!", XDecisionDataLogType.ERROR),


    VARIABLE_NAME_ERROR(8000, "变量编码必须存在，且为非数字，且不能以数字开头!", XDecisionDataLogType.ERROR),
    DATA_NO_SUCH_MIGRATE_TYPE_ERROR(8001, "没有该类型的变量迁移!", XDecisionDataLogType.ERROR),


    DATA_INTERFACE_CONFIG_EMPTY_ERROR(9000, "接口数据源配置缺失!", XDecisionDataLogType.ERROR),



    SUCCESS(10000, "响应成功!", XDecisionDataLogType.INFO),
    FAIL(20000, "响应失败!", XDecisionDataLogType.ERROR);


    public int code;
    public String text;
    public String template;
    public XDecisionDataLogType logType;

    XDecisionDataExceptionType(int code, String text, XDecisionDataLogType logType) {
        this.code = code;
        this.text = text;
        this.template = text;
        this.logType = logType;
    }

    XDecisionDataExceptionType(int code, String text, String template, XDecisionDataLogType logType) {
        this.code = code;
        this.text = text;
        this.template = template;
        this.logType = logType;
    }


}
